package com.kt.dion.golf.data;

import java.util.ArrayList;

import com.kt.dion.golf.util.ResourceManager;

public class ChampionListData extends Data
{
	private ArrayList arrPlayer = new ArrayList();
	private boolean isEvent;
	private String nameBannerImage;

	public void addPlayer(Player player)
	{
		arrPlayer.add(player);
	}

	public Player getPlayer(int i)
	{
		if (i < arrPlayer.size())
			return (Player) arrPlayer.get(i);
		return null;
	}

	public int getDataSize()
	{
		return arrPlayer.size();
	}

	public boolean isEvent()
	{
		return isEvent;
	}

	public void setEvent(boolean isEvent)
	{
		this.isEvent = isEvent;
	}

	public String getNameBannerImage()
	{
		return nameBannerImage;
	}

	public void setNameBannerImage(String nameBannerImage)
	{
		this.nameBannerImage = nameBannerImage;
	}

	public class Player extends Data
	{
		String code;
		String name;
		String imageName;

		public String getCode()
		{
			return code;
		}

		public void setCode(String code)
		{
			this.code = code;
		}

		public String getImageName()
		{
			return imageName;
		}

		public void setImageName(String imageName)
		{
			this.imageName = imageName;
		}

		public String getName()
		{
			return name;
		}

		public void setName(String name)
		{
			this.name = name;
		}

		public String toString()
		{
			return null;
		}

		public void dispose(boolean isDisposeOfPage)
		{
			ResourceManager.getInstance().removeImage(imageName);
			imageName = null;
		}
	}

	public void dispose(boolean isDisposeOfPage)
	{
		for (int i = 0; i < arrPlayer.size(); i++)
		{
			getPlayer(i).dispose(false);
		}

		ResourceManager.getInstance().removeImage(nameBannerImage);
		nameBannerImage = null;
	}

	public String toString()
	{
		return null;
	}
}
